file_path = input("文件路径（直接拖入）：")
f = open(file_path, 'r')
QQ = []
eachone = []
floor = 11
for ch in f:
    if 'QQ&' in ch:
        num = ch.split('&', 1)[1].split()[0]
    if '$' in ch:
        try:
            temp = int(num)
        except:
            temp = 0
        eachone = [floor, temp]
        QQ.append(eachone)
        eachone = [floor, temp]
        num = 'null'
        floor += 1
print(QQ)
r = open('result.txt', mode='w')
for eachitem in QQ:
    r.writelines(str(eachitem)+'\n')
f.close()
r.close()






        # for num in f:
        #     if isinstance(num, int):
        #             temp = temp*10 + num
        # for end in f:
        #         f end == '$':
        #             QQ.append(temp)
        #             temp = 0
